﻿using SuperX.SuperSocket.Common;

namespace SuperX.SuperSocket.Client.UpLoad.Command
{
    internal class CheckExist : UpLoadCommandBase
    {
        public override void ExecuteCommand(UpLoadEngine session, TransferCommandInfo commandInfo)
        {
            if (commandInfo.Text == "1")
            {
                if (session.OnFileExist())
                {
                    session.DoUpLoad();
                }
            }
            else
            {
                //准备发送
                session.DoUpLoad();
            }
        }

        public override string Name
        {
            get
            {
                return Tag.CheckExist.ToString();
            }
        }
    }
}